package cn.graydove.bot.service.impl;

import cn.graydove.bot.model.entity.Violation;
import cn.graydove.bot.repository.ViolationRepository;
import cn.graydove.bot.service.ViolationService;
import org.springframework.stereotype.Service;

@Service
public class ViolationServiceImpl implements ViolationService {

    private ViolationRepository violationRepository;

    public ViolationServiceImpl(ViolationRepository violationRepository) {
        this.violationRepository = violationRepository;
    }

    @Override
    public Violation add(Long qq, Long group, String reason) {
        Violation violation = new Violation(qq, group, reason);
        return violationRepository.save(violation);
    }
}
